package cn.lin.factory;
/**
 * @author liufl E-mail:Huberier@allpyra.com
 * @version 创建时间：2017年8月21日 上午9:56:39
 * 原型模式
 */
public class PrototypeMode implements Cloneable {

	private int age;
	
	private String name;
	
	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "PrototypeMode [age=" + age + ", name=" + name + "]";
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		PrototypeMode obj = null;  
        try{  
        	obj = (PrototypeMode)super.clone();  
        }catch(CloneNotSupportedException e) {  
            e.printStackTrace();  
        }  
        return obj;  
	}
}

